#if _MSC_VER
 #pragma once
#endif

#ifndef __APPUTIL_TIMERVIEW_INCLUDED__
 #define __APPUTIL_TIMERVIEW_INCLUDED__
 #include "AppUtilTiming.hxx"

// TODO: Some documentation
HerzeleidTimingNamespaceBegin class TimerView
{

protected:

	// Temp variables. 

	UInt64			m_TicksPerSecond64;		// Stores ticks pre second count.
	UInt64			m_OneSecondTicks64;		// Stores one second ticks count.
	UInt64			m_StartupTicks64;		// Stores start tick value.
	UInt64			m_CurrentTicks64;		// Stores currect tick value.
	UInt64			m_LastTicks64;			// Stores last tick value. 
	Bool			m_bUseFixedDelta;		// Indicates whether the step is fixed. 
	Int32			m_iFrameCount;			// Stores frame count. 
	Int32			m_iFramesPerSecond;		// Stores framerate. 
	Int32			m_iMaxFramesPerSecond;	// Stores max framerate. 
	Float32			m_fFixedDelta;			// Stores fixed step value. 
	Float32			m_fDelta;				// Stores elapsed. 

public:

	TimerView();

	DeclGetPropOnly( Float32Const, Elapsed );									// Gets elapsed time. 
	REIGN_FORCEINLINING DeclConstTypedGetterFor( Float32Const, Elapsed )						// Gets elapsed time. 
	{
		auto const High = (Float32)(m_CurrentTicks64 - m_StartupTicks64);
		auto const Low = (Float32)(m_TicksPerSecond64);
		return ((Float32)(High/Low));
	}

	DeclGetPropOnly( Float32Const, Runtime );									// Gets run time. 
	REIGN_FORCEINLINING DeclConstTypedGetterFor( Float32Const, Runtime )		// Gets run time. 
	{
		return ( m_fDelta );
	}

	DeclGetPropOnly( Int32Const, Framerate );									// Gets fps. 
	REIGN_FORCEINLINING DeclConstTypedGetterFor( Int32Const, Framerate )		// Gets fps.  
	{
		return ( m_iFramesPerSecond );
	}

	DeclGetPropOnly( Int32Const, FrameCount );									// Gets frame count. 
	REIGN_FORCEINLINING DeclConstTypedGetterFor( Int32Const, FrameCount )		// Gets frame count.
	{
		return ( m_iFrameCount );
	}

	DeclGetPropOnly( Int32Const, MaxFramerate );								// Gets max fps. 
	REIGN_FORCEINLINING DeclConstTypedGetterFor( Int32Const, MaxFramerate )		// Gets max fps. 
	{
		return ( m_iMaxFramesPerSecond );
	}

} HerzeleidTimingNamespaceEnd; 

//#ifdef REIGN_DESKTOP
HerzeleidTimingNamespaceBegin
	TinyTypeDecl( TimerView );
HerzeleidTimingNamespaceEnd
//#endif // REIGN_DESKTOP

#endif // !HERZELEID_TIMERVIEW_INCLUDED__
